<%@page import="cn.jekun.shop.common.service.OrderService"%>
<%@page import="cn.jekun.component.base.bean.SessionUser"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"
	contentType="text/html; charset=UTF-8"%>
<%@ include file="/v1/pages/public/head.jsp"%>
<body>
<%@ include file="/v1/pages/public/head_menu.jsp"%>
<div class=" ldh-mainCenter">
	<div class="cont_1240">
    	<div class="ldh-suborder">
        	<div class="ldh-suborderTop clearfix">
            	<div class="ldh-suborderTop-title"><h3>收货信息确认</h3></div>
            	<div class="ldh-suborderTop-info">
            	  
                      <div class="ldh-suborderTop-infolist clearfix">
                    	<label>配送方式：</label>
                        <div class="ldh-suborderTop-infocont ldh-suborderTop-payment" id="orderDeliveryType">
                        	
                        </div>
                    </div>
                	<div class="ldh-suborderTop-infolist clearfix" id="deliveryTime"> 
                    	<label>送货时间：</label>
                        <div class="ldh-suborderTop-infocont">
                        	<div class="btn-group">
                                <button data-toggle="dropdown" class="btn dropdown-toggle"><span id="span_shipTime">尽快送达</span>&nbsp;&nbsp;<span class="caret"></span></button>
                                <ul class="dropdown-menu">
                                  <li><a href="javascript:$ldh_order.setShipTime('尽快送达','尽快送达')">尽快送达</a></li>
                                  <li><a href="javascript:$ldh_order.setShipTime('8:00-11:00','8:00-11:00')">8:00-11:00</a></li>
                                  <li><a href="javascript:$ldh_order.setShipTime('11:00-14:00','11:00-14:00')">11:00-14:00</a></li>
                                  <li><a href="javascript:$ldh_order.setShipTime('14:00-17:00','14:00-17:00')">14:00-17:00</a></li>
                                  <li><a href="javascript:$ldh_order.setShipTime('17:00-20:00','17:00-20:00')">17:00-20:00</a></li>
                                </ul>
                            </div>
                        </div>
                    </div>
                    
                     <div class="ldh-suborderTop-infolist clearfix" id="zitiTime" style="display:none;">
                       <label>自提时间：</label>
                       <span></span>
                    </div>
                    
                  
                    <div class="ldh-suborderTop-infolist clearfix">
                    	<label>支付方式：</label>
                        <div class="ldh-suborderTop-infocont ldh-suborderTop-payment" id="orderPaymentType">
                        	
                        </div>
                    </div>
                    <div class="ldh-suborderTop-infolist clearfix" id="deliveryAddress">
                    	<label>收货地址：</label>
                        <div class="ldh-suborderTop-infocont">
                        	<div class="ldh-myAdress">
                              <div class="ldh-myAdress-info">
                                  <ul id="myAddressList">
                                      
                                  </ul>
                                  
                              </div>
                              <div class="ldh-myAdress-new">
                                  <button type="button" class="btn-yellow" onclick="$ldh_order.openEditAddress()">添加新地址</button>
                              </div> 
                              <div class="ldh-myAdress-edit">
                                 	<div class="ldh-myAdress-editList" id="div_address_tip" style="display: none;">
	                                	<label>&nbsp;</label>
	                                	<p class="ldh-myAdress-editListR"><span class="ldh-change-tips" >&nbsp;</span></p>  
	                            	</div>
	                            
		                            <div class="ldh-myAdress-editList" id="div_address_loading" style="display:none;" >
		                                <div class="ldh-waiting" style="height:20px;"></div> 
		                            </div>
		                            
		                            <div class="ldh-myAdress-editList">
		                                <label><i class="red">*</i>收货人：</label>
		                                <div class="ldh-myAdress-editListR"><input type="text" id="order_shipName"></div>  
		                            </div>
                                  <div class="ldh-myAdress-editList">
                                      <label><i class="red">*</i>所在地区：</label>
                                           <div class="ldh-myAdress-editListR">
                                	<div class="btn-group">
                                        <button data-toggle="dropdown" class="btn dropdown-toggle"><span id="province_name">请选择</span>&nbsp;&nbsp;<span class="caret"></span></button>
                                        <ul class="dropdown-menu" id="provinceList" style="height:200px;overflow:auto;">
                                          
                                     
                                        </ul>
                                    </div>
                                	<div class="btn-group">
                                        <button data-toggle="dropdown" class="btn dropdown-toggle"><span id="city_name">请选择</span>&nbsp;&nbsp;<span class="caret"></span></button>
                                        <ul class="dropdown-menu" id="cityList" style="height:200px;overflow:auto;">
                                         
                                        </ul>
                                    </div>
                                    <div class="btn-group">
                                        <button data-toggle="dropdown" class="btn dropdown-toggle"><span id="region_name">请选择</span>&nbsp;&nbsp;<span class="caret"></span></button>
                                        <ul class="dropdown-menu" id="regionList" style="height:200px;overflow:auto;">
                                          
                                        </ul>
                                    </div>
                                </div>
                                  </div> 
                                      <div class="ldh-myAdress-editList">
                                <label><i class="red">*</i>详细地址：</label>
                                <div class="ldh-myAdress-editListR"><input class="adressInput" type="text" id="order_ship_address" placeholder="详细的地址"></div>  
                            	</div>
	                           <div class="ldh-myAdress-editList">
	                                <label><i class="red">*</i>手机号码：</label>
	                                <p class="ldh-myAdress-editListR"><input type="text" id="order_ship_mobile">
	                            </p>
	                            </div> 
	                            <div class="ldh-myAdress-editList">
	                                <label>&nbsp;</label>
	                                <p class="ldh-myAdress-editListR"><button type="button" class="btn-main" id="btn_edit_address" onclick="$ldh_order.saveAddress(0)">保存</button></p>  
	                            </div>                      
                              </div>                     	
                           </div>
                        </div>
                    </div>
                    
                    <div class="ldh-suborderTop-infolist clearfix" id="shopAddress" style="display:none;">
                       <label>自提地址：</label>
                       <span></span>
                    </div>
                                  
                </div> 
            
            </div>
            <div class="ldh-suborderMain clearfix">
            	<div class="ldh-suborderMain-title"><h3>订单信息确认</h3></div>
            	<div class="ldh-suborderMain-info">
                	<div class="ldh-myOrder-detailsTable">
                      <table id="orderGoodList">
                        <colgroup >
                        <col width="40%;" />
                        <col width="20%" />
                        <col width="18%" />
                        <col width="22%" />
                        </colgroup>
                        <thead>
                          <tr>
                            <th>商品</th>
                            <th>单价</th>
                            <th>数量</th>
                            <th>小计</th>
                          </tr>
                        </thead>
                       <!--  <tbody>
                          <tr><td class="text-left ldh-order-storeinfo" colspan="4"><span>商户：<b>尚食速度餐厅</b></span><span>电话：<b>020-62579864</b></span></td></tr>                  
                          <tr>
                            <td>
                            <table>
                                <colgroup >
                                <col width="16%" />
                                <col width="41%" />
                                </colgroup>
                                <tbody>                                  
                                  <tr>
                                    <td class="text-center"><div class="ldh-orderpic"><a class="pic" href="javascript:void(0)" target="_blank"><img src="img/fenlei_fresh.png" alt="查看宝贝详情" /></a></div></td>
                                    <td class="text-left"><a class="text" href="product.html" target="_blank"> 2012韩版时尚休闲百搭清凉透气不规则皱丝松紧五分袖涂鸦雪纺衫 </a></td>                            
                                  </tr>
                                </tbody>
                              </table>
                            </td>
                            <td>¥20.00</td>
                            <td>2</td>
                            <td>¥60.00</td>
                          </tr>
                          <tr>
                            <td>
                            <table>
                                <colgroup >
                                <col width="16%" />
                                <col width="41%" />
                                </colgroup>
                                <tbody>
                                  <tr>
                                    <td class="text-center"><div class="ldh-orderpic"><a class="pic" href="javascript:void(0)" target="_blank"><img src="img/fenlei_fresh.png" alt="查看宝贝详情" /></a></div></td>
                                    <td class="text-left"><a class="text" href="product.html" target="_blank"> 2012韩版时尚休闲百搭清凉透气不规则皱丝松紧五分袖涂鸦雪纺衫 </a></td>                            
                                  </tr>
                                </tbody>
                              </table>
                            </td>
                            <td>¥20.00</td>
                            <td>2</td>
                            <td>¥60.00</td>
                          </tr>
                          <tr>
                            <td>
                            <table>
                                <colgroup >
                                <col width="16%" />
                                <col width="41%" />
                                </colgroup>
                                <tbody>
                                  <tr>
                                    <td class="text-center"><div class="ldh-orderpic"><a class="pic" href="javascript:void(0)" target="_blank"><img src="img/fenlei_fresh.png" alt="查看宝贝详情" /></a></div></td>
                                    <td class="text-left"><a class="text" href="product.html" target="_blank"> 2012韩版时尚休闲百搭清凉透气不规则皱丝松紧五分袖涂鸦雪纺衫 </a></td>                            
                                  </tr>
                                </tbody>
                              </table>
                            </td>
                            <td>¥20.00</td>
                            <td>2</td>
                            <td>¥60.00</td>
                          </tr>
                          <tr>
                              <td  colspan="3" class="text-left ldh-gessage-bbs"><span>给卖家留言：</span><textarea class="textarea" cols="100"></textarea></td>
                              <td class="text-right ldh-myOrder-total"><span>总计：</span><span>¥180.00</span></td>
                          </tr>
                        </tbody> -->
                        
                      
                      </table>
                    </div>
                </div> 
            
            </div>
             <div class="ldh-suborderBtm clearfix">
            	<!-- <button class="fl-left btn-green">返回</button> -->
            	<%-- 验证码 --%>
            	<%
            	//判断是否需要增加验证码
            	MemberSession memberSession = (MemberSession)request.getSession().getAttribute(SessionUser.SESSION_KEY);
            	if(memberSession!=null && memberSession.getUserId() != null){
	            	String ip = null;
	            	try{
	        			ip = request.getHeader("x-forwarded-for");  
	        			if(ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {  
	        				ip = request.getHeader("Proxy-Client-IP");  
	        			}  
	        			if(ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {  
	        				ip = request.getHeader("WL-Proxy-Client-IP");  
	        			}  
	        			if(ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {  
	        				ip = request.getRemoteAddr();  
	        			}  
	        		}catch(Exception e){
	        			ip = null;
	        		}
            		
	            	OrderService orderService = SpringUtils.getBean(OrderService.BEAN_NAME);
	            	if(orderService.isAddOrderFrequently(memberSession.getUserId(), ip)){//频繁下单
	            %>
            			 <div class="fl-right">
            				<input type="text" id="randomCode" placeholder="输入验证码" /><span><img id="imgCode" onclick="javascript:$ldh_order.refresh()"  src="${ctx}/ImageServlet" /></span><a href="javascript:$ldh_order.refresh()"> 换一张</a>
            			</div>
	            <%
	            	}
            	}
            	%>
            	<button class="fl-right btn-main" onclick="$ldh_order.addOrder(this)" id="btn_suborder">提交订单</button>    
            	<div align="right" id="orderErrorMsg" style="color: red;"></div>       
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">

seajs.use([ctx+'/v1/js/custom/order/module-suborder.js'],function(m){
	m.init(m);	
});
</script>
<%@ include file="/v1/pages/public/foot.jsp"%>


